(function($){
    $("#loginForm").validation({icon:true});
    $(document).keypress(function(e) {
        // 回车键事件
        if(e.which == 13) {
            jQuery("#loginButton").click();
        }
    });
    $("#loginButton").on("click",function(){
        if($("#loginForm").valid()){
            restAjax("login/login",window.RequestMethod.POST,{formId:"loginForm",success:function(data){
                if(data.suc){
                    window.location.href = window.BASETATH+"starter.html";
                }else{
                    window.Dialog.alert(data.message)
                }
            }});
        }
    });
})(jQuery);